/**
   UserleavewordService
 * Time:2018年6月5日
 */
package com.ssm.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ssm.dao.UsercommentMapper;
import com.ssm.dao.UserleavewordMapper;
import com.ssm.entity.Page;
import com.ssm.entity.Userleaveword;
import com.ssm.entity.UserleavewordExample;
import com.ssm.entity.UserleavewordExample.Criteria;
import com.ssm.entity.UserleavewordExample.Criterion;
import com.ssm.entity.vo.UserleavewordVo;
import com.ssm.service.UserleavewordService;

/**
 * @author 15199
 *
 */
@Service("userleavewordService")
public class UserleavewordServiceImpl implements UserleavewordService {
	
	@Resource 
	
	UserleavewordMapper userleavewordMapper;
	
	/* (non-Javadoc)
	 * @see com.ssm.service.UserleavewordService#getAll(com.ssm.entity.Page, com.ssm.entity.vo.UserleavewordVo)
	 */
	
	@Override
	public List<Userleaveword> getAll(Page page, UserleavewordVo userleavewordVo) {
		// TODO Auto-generated method stub
		UserleavewordExample userleavewordExample=new UserleavewordExample();
        userleavewordExample.setPage(page);
		Criteria criteria= userleavewordExample.or();
		if(userleavewordVo.getUlid()!=null){
	
			criteria.andUlidEqualTo(userleavewordVo.getUlid());
		
		}
		if(userleavewordVo.getUserid()!=null){

			criteria.andUlidEqualTo(userleavewordVo.getUserid());
		
		}
        if(userleavewordVo.getUsermsgtime()!=null){
        	
        	criteria.andUsermsgtimeLike("%"+userleavewordVo.getUsermsgtime()+"%");
        	
        }

       
		return userleavewordMapper.selectByExample(userleavewordExample);



	}

	/* (non-Javadoc)
	 * @see com.ssm.service.UserleavewordService#getcount()
	 */
	@Override
	public int getcount() {
		// TODO Auto-generated method stub
		UserleavewordExample userleavewordExample=new UserleavewordExample();
		
		return userleavewordMapper.countByExample(userleavewordExample);
	}

	/* (non-Javadoc)
	 * @see com.ssm.service.UserleavewordService#deleteById(int)
	 */
	@Override
	public int deleteById(int id) {
		// TODO Auto-generated method stub
		UserleavewordExample userleavewordExample=new UserleavewordExample();
		
		return userleavewordMapper.deleteByPrimaryKey(id);
		
		
	}

	/* (non-Javadoc)
	 * @see com.ssm.service.UserleavewordService#deleteAll(java.lang.String)
	 */
	@Override
	public int deleteAll(String json) {
		// TODO Auto-generated method stub
		
		
		
		return 0;
	}







}
